package edu.nyp.locationservicesapp.base;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;

import edu.nyp.locationservicesapp.R;

/**
 * Activity 基类
 * Created by Gaolei on 2016/11/25.
 */

public class BaseActivity extends AppCompatActivity {
    @Override
    public void onBackPressed() {  //点击返回键关闭界面
        finish();
        overridePendingTransition(R.anim.activity_in_from_left, R.anim.activity_out_from_right);
    }


    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case android.R.id.home:
                finish();
                overridePendingTransition(R.anim.activity_in_from_left, R.anim.activity_out_from_right);
                break;
        }
        return super.onOptionsItemSelected(item);
    }
}
